using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ShootThemUp.Sources.GameElements.Ships.Ennemies.Fruits;

namespace ShootThemUp.Sources.Factories
{
    /// <summary>
    /// This factory makes Fruit instances in function of a fruit type.
    /// </summary>
    public static class FruitFactory
    {
        #region Factory methods

        /// <summary>
        /// Grows a fruit in function of the fruit type given.
        /// </summary>
        /// <param name="type">The type of the fruit to grow.</param>
        /// <returns>The fruit created in function of the type given.</returns>
        public static Fruit GrowFruit(FruitType type)
        {
            return FruitFactory.GrowFruit(type, 0);
        }

        /// <summary>
        /// Grows a fruit in function of the fruit type given.
        /// </summary>
        /// <param name="type">The type of the fruit to grow.</param>
        /// <param name="delay">The delay before the first fruit shot.</param>
        /// <returns>The fruit created in function of the parameters given.</returns>
        public static Fruit GrowFruit(FruitType type, float delay)
        {
            Fruit fruit = null;

            switch (type)
            {
                case FruitType.Cherry: fruit = new Cherry(delay); break;
                case FruitType.Pear: fruit = new Pear(delay); break;
                case FruitType.Orange: fruit = new Orange(); break;
            }

            return fruit;
        }
        #endregion
    }
}
